<!DOCTYPE html>
<html>
<head>
    <title>商品分类表</title>
		<#include "/header.html">
  <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrap-table.min.css">
  <link rel="stylesheet" href="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.css">
  <script src="${request.contextPath}/statics/libs/bootstrap-table.min.js"></script>
  <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.min.js"></script>
  <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.bootstrap3.js"></script>
  <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.extension.js"></script>
  <script src="${request.contextPath}/statics/plugins/treegrid/tree.table.js"></script>
  <link rel="stylesheet" href="${request.contextPath}/statics/plugins/iview/css/iview.css">
  <script src="${request.contextPath}/statics/plugins/iview/iview.min.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("goods:category:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("goods:category:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("goods:category:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <!--<table id="jqGrid"></table>-->
        <!--<div id="jqGridPager"></div>-->
        <table id="cateTable" data-mobile-responsive="true" data-click-to-select="true">
          <thead>
          <tr>
            <th data-field="selectItem" data-checkbox="true"></th>
          </tr>
          </thead>
        </table>
    </div>

    <div v-show="!showList" class="panel panel-default" >
        <div class="panel-heading" style="margin-bottom: 30px">{{title}}</div>
      <i-form ref="formValidate" :model="category" :rules="ruleValidate" :label-width="80">
        <Form-item label="上级分类" prop="pname">
          <i-input v-model="category.pname" @on-click="cateTree" icon="eye" readonly="readonly" style="width: 188px;"
                   placeholder="上级分类"/>
        </Form-item>
        <Form-item label="分类名称" prop="name">
          <i-input v-model="category.name" placeholder="分类名称" style="width: 600px;"/>
        </Form-item>
        <Row>
          <i-col span="16">
            <Form-item label="分类图标" prop="imgUrl">
              <i-input v-model="category.imgUrl" placeholder="分类图标" style="width: 600px;" readonly/>
            </Form-item>
          </i-col>
          <i-col span="3">
            <Form-item :label-width="1">
              <Upload style="width: 300px;" :action="baseURL+'/sys/oss/upload'" :format="['jpg','jpeg','png']"
                      max-size="2048"
                      :on-success="handleSuccessListPicUrl" :on-format-error="handleFormatError"
                      :show-upload-list="false"
                      :on-exceeded-size="handleMaxSize">
                <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
              </Upload>
            </Form-item>
          </i-col>
          <i-col span="3">
            <Form-item :label-width="1">
              <i-button icon="eye" @click="eyeImageListPicUrl(category.imgUrl)">预览图片</i-button>
            </Form-item>
          </i-col>
        </Row>
        <Form-item label="排序" prop="sortNo">
          <Input-number :min="0" :step="1" v-model="category.sortNo" placeholder="排序"
                        style="width: 188px;"/>
        </Form-item>
        <Form-item>
          <i-button type="primary" @click="handleSubmit('formValidate')" style="background-color: #286090;">确定</i-button>
          <i-button type="warning" @click="reload" style="margin-left: 8px;background-color: #ec971f;"/>返回</i-button>
        </Form-item>
      </i-form>
    </div>
</div>
<div id="cateLayer" style="display: none;padding:10px;">
  <ul id="cateTree" class="ztree"></ul>
</div>

<script src="${request.contextPath}/statics/js/modules/goods/category.js?_${.now?long}"></script>
</body>
</html>